import utils from './utils'
import action from './action'
import store from './store'

let uri = ''
let dev = window.location.href.indexOf(':3000') > 0
if (dev) {
  uri = 'http://127.0.0.1:7000'
}

let api = {
  getTel: function (callback) {
    utils.Get({
      url: uri + '/get_tel',
      event: function (res) {
        console.log(res)
        callback(res)
      }
    })
  },
  postTel: function (data = { tel: '' }, callback) {
    utils.Post({
      url: uri + '/post_tel',
      data: {
        tel:data.tel,
        token:'123'
      },
      event: function (res) {
        console.log(res)
        callback(res)
      }
    })
  },
}
window.api = api
export {
  api, action, store, dev
} 